<%--
  Created by IntelliJ IDEA.
  User: root
  Date: 5/11/17
  Time: 11:22 PM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div class="modal-body form-horizontal">
    <form name='userForm'>

        <div class="form-group">
            <label for="title" class="col-sm-3 control-label">账号：</label>
            <div class="col-sm-6">
                <input type="text" class="form-control" ng-model="user.username" placeholder="账号" name="username" required >
            </div>
            <div class="col-md-2">
                <p class="form-control-static">
                    <code ng-show="userForm.username.$error.required">必填</code>
                </p>
            </div>
        </div>
        <div class="form-group">
            <label for="title" class="col-sm-3 control-label">姓名：</label>
            <div class="col-sm-6">
                <input type="text" class="form-control" ng-model="user.name" placeholder="姓名" name="name" required >
            </div>
            <div class="col-md-2">
                <p class="form-control-static">
                    <code ng-show="userForm.name.$error.required">必填</code>
                </p>
            </div>
        </div>

        <div class="form-group">
            <label for="title" class="col-sm-3 control-label">密码：</label>
            <div class="col-sm-6">
                <input type="text" class="form-control" ng-model="user.password" placeholder="密码" name="password" >
            </div>
            <div class="col-md-2">
                <p class="form-control-static">
                    <code ng-show="!user.id && user.password">必填</code>
                </p>
            </div>
        </div>

        <div class="form-group">
            <label for="title" class="col-sm-3 control-label">确认密码：</label>
            <div class="col-sm-6">
                <input type="text" class="form-control" ng-model="passwordConform" placeholder="确认密码" name="passwordConform" >
            </div>
            <div class="col-md-2">
                <p class="form-control-static">
                    <code ng-show="!user.id && (userForm.passwordConform.$error.required || passwordConform != user.password)">必填</code>
                </p>
            </div>
        </div>
    </form>
    <div id="error-alert" class="alert alert-danger fade in" role="alert" ng-show="errorMsg">
        <p id="error-message">
            错误：{{errorMsg}}
        </p>
    </div>

</div>
<div class="modal-footer">
    <button type="button" class="btn btn-default" ng-click="cancel()">取消</button>
    <button type="button" class="btn btn-primary" ng-click="save()" ng-disabled="!userForm.$valid || (user.password != passwordConform)">保存</button>
</div>
